// @ts-ignore
/* eslint-disable */
import request from '@/utils/request'

/** 此处后端没有提供注释 POST /sysRole/addRoleToPermissions */
export async function addRoleToPermissions(
  body: UserService.RoleAssignPermissionVO,
  options?: { [key: string]: any }
) {
  return request<UserService.ResultString>(`/user/sysRole/addRoleToPermissions`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 GET /sysRole/allRoles */
export async function selectAllRoles(options?: { [key: string]: any }) {
  return request<UserService.ResultListSysRole>(`/user/sysRole/allRoles`, {
    method: 'GET',
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /sysRole/createRole */
export async function createRole(body: UserService.SysRole, options?: { [key: string]: any }) {
  return request<UserService.ResultString>(`/user/sysRole/createRole`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 DELETE /sysRole/deleteRole/${param0} */
export async function deleteRole(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: UserService.deleteRoleParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params
  return request<UserService.ResultString>(`/user/sysRole/deleteRole/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 GET /sysRole/getPermissions/${param0} */
export async function getRolePermissions(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: UserService.getRolePermissionsParams,
  options?: { [key: string]: any }
) {
  const { roleId: param0, ...queryParams } = params
  return request<UserService.ResultListLong>(`/user/sysRole/getPermissions/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /sysRole/updateRole */
export async function updateRole(body: UserService.SysRole, options?: { [key: string]: any }) {
  return request<UserService.ResultString>(`/user/sysRole/updateRole`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}
